<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String ctxPath = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ ctxPath + "/";
	String SYSTEM_NAME = "EZMES";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base id="baseUrl" href="<%=basePath%>">

<title>My JSP 'update_user.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<base href="<%=basePath%>">

</head>
<link href="<%=basePath%>css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
<link href="<%=basePath%>css/font-awesome.min.css?v=4.3.0"
	rel="stylesheet">

<!-- Data Tables -->
<link href="<%=basePath%>css/animate.min.css" rel="stylesheet">
<link href="<%=basePath%>css/style.min.css?v=3.0.0" rel="stylesheet">
<body>
	<form  method="post" id="formId">
		<input type="hidden" name="newsType.nt_id" value="${newsType.nt_id}">
		<div class="col-md-12">
			<div class="form-group" style="padding: 20px">
				<label class="col-sm-3 control-label">序号：</label>
				<div class="col-sm-9">
					<input type="text" name="newsType.nt_name" class="form-control"
						required="" placeholder="请输入邮箱" value="${newsType.nt_name}" id="sortId">
				</div>
			</div>
		</div>
		<div class="col-md-12" style="text-align: center; margin-bottom: 10px">
			<button type="submit" class="btn btn-primary" onclick="updateSort()">
				<i class="fa fa-check"></i> 修改
			</button>
		</div>
	</form>
</body>
<script src="<%=basePath%>js/jquery-2.1.1.min.js"></script>
<script src="<%=basePath%>js/bootstrap.min.js?v=3.4.0"></script>
<script src="<%=basePath%>js/plugins/jeditable/jquery.jeditable.js"></script>
<script type="text/javascript">
$(function(){
	initSort();
});
function initSort(){
	var sort = parent.layer.sort;
	$("#sortId").val(sort);
}
function updateSort(){
	var sort = $("#sortId").val();
	var nid = parent.layer.nid;
	var yuansu = parent.layer.yuansu;
	$.ajax({
		type:"post",
		data:{"news.n_sort":sort,"news.n_id":nid},
		url :$('#baseUrl').attr("href")+'news/updateNewsSort',
		success:function(data){
			if(data.isOk){
				yuansu.text(sort);
				var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
			    parent.layer.close(index);
			}else{
				alert(data.value);
			}
		}
	});
}
</script>
</html>
